import 'package:flutter/material.dart';
import 'package:flutter_boost/boost_navigator.dart';

class PageTwo extends StatefulWidget {
  Object? arguments;

  PageTwo(this.arguments);

  @override
  _PageTwoState createState() => _PageTwoState();
}

class _PageTwoState extends State<PageTwo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("界面二"),
      ),
      body: Container(
        child: Center(
          child: Column(
            children: [
              Text('接收到得参数为：${widget.arguments.toString()}'),
              ElevatedButton(
                child: Text("关闭当前页"),
                onPressed: () {
                  Navigator.pop(context, {"ffff":"rrrrr"});
                  // BoostNavigator.instance.pop({'retval' : 'I am from dart...'});
                  // Navigator.pop(context, "result from flutter");//如果不是json格式 native 接收不到？
                },
              )
            ],
          ),
        ),
      ),
    );
  }
}
